package me.quexi.georgia.observer;

import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import me.quexi.georgia.interfaces.INotification;
import me.quexi.georgia.vo.HttpContext;

public class Notification implements INotification {
	
	private int _name = 0;
	private HashMap<String, Object> _body = null;
	private HttpContext _httContext = null;

	/**
	 * 消息实例
	 * @param name 消息名
	 * @param body 消息内容
	 * @param request 
	 * @param response
	 */
	public Notification(int name, HashMap<String, Object> body, 
			HttpServletRequest request, HttpServletResponse response)
	{
		_name = name;
		_body = body;
		
		_httContext = HttpContext.createHttpContext(request, response);
	}
	
	public Notification(int name, HashMap<String, Object> body, 
			HttpContext httContext)
	{
		_name = name;
		_body = body;
		
		_httContext = httContext;
	}

	@Override
	public HashMap<String, Object> getBody() {
		return _body;
	}

	@Override
	public int getName() {
		return _name;
	}
	
	public HttpContext get_httContext() {
		return _httContext;
	}

}
